import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';

import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';

import { olReducers } from './store';

import { components, modules } from './components';
import { services } from './services';

@NgModule({
  imports: [
    CommonModule,
    ReactiveFormsModule,
    HttpClientModule,
    StoreModule.forFeature('openlayers', olReducers)
  ],
  declarations: [
    ...components
  ],
  exports: [
    ...components,
    ...modules
  ],
  providers: [
    ...services
  ]
})
export class NgxOlModule { 
  static forRoot(): ModuleWithProviders {
    return {
      ngModule : NgxOlModule,
      providers: [ 
        ...services
      ] // Services
    };
  }
}
